package com.wzh.codegen.biz.domain.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.NotNull;
import lombok.Data;

/**
 * 数据源DTO
 *
 * @author wzh
 * @since 2024-01-01
 */
@Data
@Schema(description = "数据源DTO")
public class DatasourceDTO {

    @Schema(description = "数据源ID")
    private Long id;

    @Schema(description = "数据源名称")
    @NotBlank(message = "数据源名称不能为空")
    private String name;

    @Schema(description = "数据库类型")
    @NotBlank(message = "数据库类型不能为空")
    private String dbType;

    @Schema(description = "数据库驱动")
    @NotBlank(message = "数据库驱动不能为空")
    private String driverClassName;

    @Schema(description = "数据库连接URL")
    @NotBlank(message = "数据库连接URL不能为空")
    private String url;

    @Schema(description = "用户名")
    @NotBlank(message = "用户名不能为空")
    private String username;

    @Schema(description = "密码")
    @NotBlank(message = "密码不能为空")
    private String password;

    @Schema(description = "数据库名")
    private String databaseName;

    @Schema(description = "状态")
    @NotNull(message = "状态不能为空")
    private Integer status = 1;

    @Schema(description = "备注")
    private String remark;

    @Schema(description = "主机")
    private String host;

    @Schema(description = "端口")
    private Integer port;

}
